package com.u.social.search.service;

import com.u.social.search.model.ArticleDTO;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: u-social
 * @description: 重排
 * @author: Alex Wu
 * @createDate: 2025-04-11 15:47
 **/

@Service
public class ReRankingService {

    public List<ArticleDTO> reRankByType(List<ArticleDTO> articles) {
        // step1 按照活动分配流量重排
        List<ArticleDTO> reRankByActivityTypeList = this.reRankByActivityType(articles);
        // step2 按照相似类型错开重排
        List<ArticleDTO> reRankBySimilarTypeList = this.reRankBySimilarType(reRankByActivityTypeList);
        return reRankBySimilarTypeList;
    }

    private List<ArticleDTO> reRankByActivityType(List<ArticleDTO> articles) {
        return new ArrayList<>(articles.size());
    }

    private List<ArticleDTO> reRankBySimilarType(List<ArticleDTO> reRankByActivityTypeList) {
        return new ArrayList<>(reRankByActivityTypeList.size());
    }
}
